/**
 * @ Author: luoqi
 * @ Create Time: 2024-03-03 00:46
 * @ Modified by: luoqi
 * @ Modified time: 2024-04-01 23:34
 * @ Description:
 */

#ifndef _COMMON_H
#define _COMMON_H

#include <rtthread.h>

#define ISARG(arg, str)         (rt_strcmp(arg, str) == 0)

#define MSG(...)                do{rt_kprintf(__VA_ARGS__); rt_kprintf("\r\n");} while(0)

#define INFO(...)                rt_kprintf(__VA_ARGS__)

#define SHOW_DATA(ptr, size)     do{                                       \
                                        for(int i = 0; i < size; i++){     \
                                            rt_kprintf(" %02X", ptr[i]);   \
                                        }                                  \
                                        rt_kprintf("\r\n");                \
                                    } while(0)

#define ARG_ERR(tag)            rt_kprintf(" #! Arg error - [%s]\r\n", tag)

#endif
